﻿using System.Collections.Generic;

namespace com.binance.client.model.enums
{
	 

	/// <summary>
	/// buy-market, sell-market, buy-limit, buy-ioc, sell-ioc,
	/// buy-limit-maker, sell-limit-maker, buy-stop-limit, sell-stop-limit.
	/// </summary>
	public sealed class OrderType
	{
		public static readonly OrderType LIMIT = new OrderType("LIMIT", InnerEnum.LIMIT, "LIMIT");
		public static readonly OrderType MARKET = new OrderType("MARKET", InnerEnum.MARKET, "MARKET");
		public static readonly OrderType STOP = new OrderType("STOP", InnerEnum.STOP, "STOP");
		public static readonly OrderType STOP_MARKET = new OrderType("STOP_MARKET", InnerEnum.STOP_MARKET, "STOP_MARKET");
		public static readonly OrderType TAKE_RPOFIT = new OrderType("TAKE_RPOFIT", InnerEnum.TAKE_RPOFIT, "TAKE_RPOFIT");
		public static readonly OrderType TAKE_RPOFIT_MARKET = new OrderType("TAKE_RPOFIT_MARKET", InnerEnum.TAKE_RPOFIT_MARKET, "TAKE_RPOFIT_MARKET");
		public static readonly OrderType INVALID = new OrderType("INVALID", InnerEnum.INVALID, null);

		private static readonly IList<OrderType> valueList = new List<OrderType>();

		static OrderType()
		{
			valueList.Add(LIMIT);
			valueList.Add(MARKET);
			valueList.Add(STOP);
			valueList.Add(STOP_MARKET);
			valueList.Add(TAKE_RPOFIT);
			valueList.Add(TAKE_RPOFIT_MARKET);
			valueList.Add(INVALID);
		}

		public enum InnerEnum
		{
			LIMIT,
			MARKET,
			STOP,
			STOP_MARKET,
			TAKE_RPOFIT,
			TAKE_RPOFIT_MARKET,
			INVALID
		}

		public readonly InnerEnum innerEnumValue;
		private readonly string nameValue;
		private readonly int ordinalValue;
		private static int nextOrdinal = 0;

	  private readonly string code;

	  internal OrderType(string name, InnerEnum innerEnum, string code)
	  {
		this.code = code;

		  nameValue = name;
		  ordinalValue = nextOrdinal++;
		  innerEnumValue = innerEnum;
	  }

	  public override string ToString()
	  {
		return code;
	  }

//JAVA TO C# CONVERTER NOTE: Fields cannot have the same name as methods:EnumLookup


		public static IList<OrderType> values()
		{
			return valueList;
		}

		public int ordinal()
		{
			return ordinalValue;
		}

		public static OrderType valueOf(string name)
		{
			foreach (OrderType enumInstance in OrderType.valueList)
			{
				if (enumInstance.nameValue == name)
				{
					return enumInstance;
				}
			}
			throw new System.ArgumentException(name);
		}
	}

}